protected $page;
/**
- * RequestContext if specified; otherwise we'll use the Context from the Page
- * @var RequestContext
+ * IContextSource if specified; otherwise we'll use the Context from the Page
+ * @var IContextSource
*/
protected $context;
}
/**
- * Get the RequestContext in use here
- * @return RequestContext
+ * Get the IContextSource in use here
+ * @return IContextSource
*/
protected final function getContext() {
- if ( $this->context instanceof RequestContext ) {
+ if ( $this->context instanceof IContextSource ) {
return $this->context;
}
return $this->page->getContext();
*/
/**
- * @var RequestContext
+ * @var IContextSource
*/
protected $mContext;
* Create an Article object of the appropriate class for the given page.
*
* @param $title Title
- * @param $context RequestContext
+ * @param $context IContextSource
* @return Article object
*/
- public static function newFromTitle( $title, RequestContext $context ) {
+ public static function newFromTitle( $title, IContextSource $context ) {
if ( NS_MEDIA == $title->getNamespace() ) {
// FIXME: where should this go?
$title = Title::makeTitle( NS_FILE, $title->getDBkey() );
/**
* Sets the context this Article is executed in
*
- * @param $context RequestContext
+ * @param $context IContextSource
* @since 1.18
*/
public function setContext( $context ) {
/**
* Gets the context this Article is executed in
*
- * @return RequestContext
+ * @return IContextSource
* @since 1.18
*/
public function getContext() {
- if ( $this->mContext instanceof RequestContext ) {
+ if ( $this->mContext instanceof IContextSource ) {
return $this->mContext;
} else {
wfDebug( __METHOD__ . " called and \$mContext is null. Return RequestContext::getMain(); for sanity\n" );
/**
* Changeslist contructor
*
- * @param $obj Skin or RequestContext
+ * @param $obj Skin or IContextSource
*/
public function __construct( $obj ) {
- if ( $obj instanceof RequestContext ) {
+ if ( $obj instanceof IContextSource ) {
$this->setContext( $obj );
$this->skin = $obj->getSkin();
} else {
* Fetch an appropriate changes list class for the specified context
* Some users might want to use an enhanced list format, for instance
*
- * @param $context RequestContext to use
+ * @param $context IContextSource to use
* @return ChangesList|EnhancedChangesList|OldChangesList derivative
*/
- public static function newFromContext( RequestContext $context ) {
+ public static function newFromContext( IContextSource $context ) {
$user = $context->getUser();
$sk = $context->getSkin();
$list = null;
protected $mSubmitText;
protected $mSubmitTooltip;
- protected $mContext; // <! RequestContext
+ protected $mContext; // <! IContextSource
protected $mTitle;
protected $mMethod = 'post';
/**
* Build a new HTMLForm from an array of field attributes
* @param $descriptor Array of Field constructs, as described above
- * @param $context RequestContext available since 1.18, will become compulsory in 1.18.
+ * @param $context IContextSource available since 1.18, will become compulsory in 1.18.
* Obviates the need to call $form->setTitle()
* @param $messagePrefix String a prefix to go in front of default messages
*/
- public function __construct( $descriptor, /*RequestContext*/ $context = null, $messagePrefix = '' ) {
- if( $context instanceof RequestContext ){
+ public function __construct( $descriptor, /*IContextSource*/ $context = null, $messagePrefix = '' ) {
+ if( $context instanceof IContextSource ){
$this->mContext = $context;
$this->mTitle = false; // We don't need them to set a title
$this->mMessagePrefix = $messagePrefix;
}
/**
- * @return RequestContext
+ * @return IContextSource
*/
public function getContext(){
- return $this->mContext instanceof RequestContext
+ return $this->mContext instanceof IContextSource
? $this->mContext
: RequestContext::getMain();
}
* Instead a new RequestContext should be created and it will implicitly create
* a OutputPage tied to that context.
*/
- function __construct( RequestContext $context = null ) {
+ function __construct( IContextSource $context = null ) {
if ( $context === null ) {
# Extensions should use `new RequestContext` instead of `new OutputPage` now.
wfDeprecated( __METHOD__ );
/**
* @param $user User
- * @param $context RequestContext
+ * @param $context IContextSource
* @param $formClass string
* @return HtmlForm
*/
- static function getFormObject( $user, RequestContext $context, $formClass = 'PreferencesForm' ) {
+ static function getFormObject( $user, IContextSource $context, $formClass = 'PreferencesForm' ) {
$formDescriptor = Preferences::getPreferences( $user );
$htmlForm = new $formClass( $formDescriptor, $context, 'prefs' );
abstract class ContextSource implements IContextSource {
/**
- * @var RequestContext
+ * @var IContextSource
*/
private $context;
/**
- * Get the RequestContext object
+ * Get the IContextSource object
*
- * @return RequestContext
+ * @return IContextSource
*/
public function getContext() {
if ( $this->context === null ) {
}
/**
- * Set the RequestContext object
+ * Set the IContextSource object
*
- * @param $context RequestContext
+ * @param $context IContextSource
*/
- public function setContext( RequestContext $context ) {
+ public function setContext( IContextSource $context ) {
$this->context = $context;
}
*/
var $title;
/**
- * @var RequestContext
+ * @var IContextSource
*/
var $context;
/**
* Construct a revision list for a given title
- * @param $context RequestContext
+ * @param $context IContextSource
* @param $title Title
*/
- function __construct( RequestContext $context, Title $title ) {
+ function __construct( IContextSource $context, Title $title ) {
$this->context = $context;
$this->title = $title;
}
/**
* Current request context
- * @var RequestContext
+ * @var IContextSource
*/
protected $mContext;
* page, and true if it was successful.
*
* @param $title Title object
- * @param $context RequestContext
+ * @param $context IContextSource
* @param $including Bool output is being captured for use in {{special:whatever}}
* @return Bool
* @deprecated since 1.18 call SpecialPageFactory method directly
*/
- public static function executePath( &$title, RequestContext &$context, $including = false ) {
+ public static function executePath( &$title, IContextSource &$context, $including = false ) {
return SpecialPageFactory::executePath( $title, $context, $including );
}
/**
* Sets the context this SpecialPage is executed in
*
- * @param $context RequestContext
+ * @param $context IContextSource
* @since 1.18
*/
public function setContext( $context ) {
/**
* Gets the context this SpecialPage is executed in
*
- * @return RequestContext
+ * @return IContextSource
* @since 1.18
*/
public function getContext() {
- if ( $this->mContext instanceof RequestContext ) {
+ if ( $this->mContext instanceof IContextSource ) {
return $this->mContext;
} else {
wfDebug( __METHOD__ . " called and \$mContext is null. Return RequestContext::getMain(); for sanity\n" );
* page, and true if it was successful.
*
* @param $title Title object
- * @param $context RequestContext
+ * @param $context IContextSource
* @param $including Bool output is being captured for use in {{special:whatever}}
*
* @return bool
*/
- public static function executePath( Title &$title, RequestContext &$context, $including = false ) {
+ public static function executePath( Title &$title, IContextSource &$context, $including = false ) {
wfProfileIn( __METHOD__ );
// @todo FIXME: Redirects broken due to this call
* normal request, and then restores them to their previous values after.
*
* @param $title Title
- * @param $context RequestContext
+ * @param $context IContextSource
*
* @return String: HTML fragment
*/
- static function capturePath( Title $title, RequestContext $context ) {
+ static function capturePath( Title $title, IContextSource $context ) {
global $wgOut, $wgTitle, $wgRequest, $wgUser, $wgLang;
// Save current globals
/**
* TODO: fold $output, etc, into this
- * @var RequestContext
+ * @var IContextSource
*/
private $context;
return $old;
}
- public function __construct( RequestContext $context = null ) {
+ public function __construct( IContextSource $context = null ) {
if ( !$context ) {
$context = RequestContext::getMain();
}
*
* @deprecated in 1.18; use Article::newFromTitle() instead
* @param $title Title
- * @param $context RequestContext
+ * @param $context IContextSource
* @return Article object
*/
- public static function articleFromTitle( $title, RequestContext $context ) {
+ public static function articleFromTitle( $title, IContextSource $context ) {
return Article::newFromTitle( $title, $context );
}
/**
* Replace the default context
- * @param $context RequestContext
+ * @param $context IContextSource
*/
- public function setContext( RequestContext $context ) {
+ public function setContext( IContextSource $context ) {
$this->context = $context;
}
* to wrap bulk update operations.
*/
abstract class RevDel_List extends RevisionListBase {
- function __construct( RequestContext $context, Title $title, array $ids ) {
+ function __construct( IContextSource $context, Title $title, array $ids ) {
parent::__construct( $context, $title );
$this->ids = $ids;
}
protected $mMaxFileSize = array();
- public function __construct( array $options = array(), RequestContext $context = null ) {
+ public function __construct( array $options = array(), IContextSource $context = null ) {
$this->mWatch = !empty( $options['watch'] );
$this->mForReUpload = !empty( $options['forreupload'] );
$this->mSessionKey = isset( $options['sessionkey'] )